import Vue from 'vue'
import Vuex from 'vuex'
import actions from '../actions/auth'
import { UPDATE_USER } from '../mutation-types'
const localStorage = require('store')

Vue.use(Vuex)

const state = {
  'count': 0,
  'site_id': 1,
  'user': null
}

const mutations = {
  INCREMENT (state) {
    state.count++
  },
  DECREMENT (state) {
    state.count--
  },
  [UPDATE_USER] (state, user) {
    console.log('UPDATE_USER', JSON.stringify(user))
    state.user = user
  }
}

export default {
  state,
  mutations,
  actions
}
